package com.crm.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.crm.entity.Dynamicmessages;
import com.crm.repository.MessageRepository;
import com.crm.service.MessageService;
@Service
public class MessageServiceImpl implements MessageService {

	
	@Autowired
	private MessageRepository messageRepository;
	@Override
	public List<Dynamicmessages> checkDyniMessage(String receiveId) {
		
		return messageRepository.checkDyniMessage(receiveId);
	}
	@Override
	public String updateMessage(Dynamicmessages message) {
		try {
			 messageRepository.saveAndFlush(message);
			 return "回复成功";
		} catch (Exception e) {
			e.printStackTrace();
			return "回复失败";
		}
		
	}

}
